3.23 \(\int \frac{\cosh ^4(x)}{a+b \cosh ^2(x)} \, dx\)

Optimal. Leaf size=59 \[ \frac{a^{3/2} \tanh ^{-1}\left (\frac{\sqrt{a} \tanh (x)}{\sqrt{a+b}}\right )}{b^2 \sqrt{a+b}}-\frac{x (2 a-b)}{2 b^2}+\frac{\sinh (x) \cosh (x)}{2 b} \]

[Out]

-((2*a - b)*x)/(2*b^2) + (a^(3/2)*ArcTanh[(Sqrt[a]*Tanh[x])/Sqrt[a + b]])/(b^2*Sqrt[a + b]) + (Cosh[x]*Sinh[x]
)/(2*b)

________________________________________________________________________________________

Rubi [A]  time = 0.105552, antiderivative size = 59, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 15, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.333, Rules used = {3187, 470, 522, 206, 208} \[ \frac{a^{3/2} \tanh ^{-1}\left (\frac{\sqrt{a} \tanh (x)}{\sqrt{a+b}}\right )}{b^2 \sqrt{a+b}}-\frac{x (2 a-b)}{2 b^2}+\frac{\sinh (x) \cosh (x)}{2 b} \]

Antiderivative was successfully verified.

[In]

Int[Cosh[x]^4/(a + b*Cosh[x]^2),x]

[Out]

-((2*a - b)*x)/(2*b^2) + (a^(3/2)*ArcTanh[(Sqrt[a]*Tanh[x])/Sqrt[a + b]])/(b^2*Sqrt[a + b]) + (Cosh[x]*Sinh[x]
)/(2*b)

Rule 3187

Int[sin[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2)^(p_.), x_Symbol] :> With[{ff = FreeF
actors[Tan[e + f*x], x]}, Dist[ff^(m + 1)/f, Subst[Int[(x^m*(a + (a + b)*ff^2*x^2)^p)/(1 + ff^2*x^2)^(m/2 + p
+ 1), x], x, Tan[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f}, x] && IntegerQ[m/2] && IntegerQ[p]

Rule 470

Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^(q_), x_Symbol] :> -Simp[(a*e^(2
*n - 1)*(e*x)^(m - 2*n + 1)*(a + b*x^n)^(p + 1)*(c + d*x^n)^(q + 1))/(b*n*(b*c - a*d)*(p + 1)), x] + Dist[e^(2
*n)/(b*n*(b*c - a*d)*(p + 1)), Int[(e*x)^(m - 2*n)*(a + b*x^n)^(p + 1)*(c + d*x^n)^q*Simp[a*c*(m - 2*n + 1) +
(a*d*(m - n + n*q + 1) + b*c*n*(p + 1))*x^n, x], x], x] /; FreeQ[{a, b, c, d, e, q}, x] && NeQ[b*c - a*d, 0] &
& IGtQ[n, 0] && LtQ[p, -1] && GtQ[m - n + 1, n] && IntBinomialQ[a, b, c, d, e, m, n, p, q, x]

Rule 522

Int[((e_) + (f_.)*(x_)^(n_))/(((a_) + (b_.)*(x_)^(n_))*((c_) + (d_.)*(x_)^(n_))), x_Symbol] :> Dist[(b*e - a*f
)/(b*c - a*d), Int[1/(a + b*x^n), x], x] - Dist[(d*e - c*f)/(b*c - a*d), Int[1/(c + d*x^n), x], x] /; FreeQ[{a
, b, c, d, e, f, n}, x]

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 208

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[-(a/b), 2]*ArcTanh[x/Rt[-(a/b), 2]])/a, x] /; FreeQ[{a,
b}, x] && NegQ[a/b]

Rubi steps

\begin{align*} \int \frac{\cosh ^4(x)}{a+b \cosh ^2(x)} \, dx &=\operatorname{Subst}\left (\int \frac{x^4}{\left (1-x^2\right )^2 \left (a-(a+b) x^2\right )} \, dx,x,\coth (x)\right )\\ &=\frac{\cosh (x) \sinh (x)}{2 b}+\frac{\operatorname{Subst}\left (\int \frac{a+(a-b) x^2}{\left (1-x^2\right ) \left (a+(-a-b) x^2\right )} \, dx,x,\coth (x)\right )}{2 b}\\ &=\frac{\cosh (x) \sinh (x)}{2 b}+\frac{a^2 \operatorname{Subst}\left (\int \frac{1}{a+(-a-b) x^2} \, dx,x,\coth (x)\right )}{b^2}-\frac{(2 a-b) \operatorname{Subst}\left (\int \frac{1}{1-x^2} \, dx,x,\coth (x)\right )}{2 b^2}\\ &=-\frac{(2 a-b) x}{2 b^2}+\frac{a^{3/2} \tanh ^{-1}\left (\frac{\sqrt{a} \tanh (x)}{\sqrt{a+b}}\right )}{b^2 \sqrt{a+b}}+\frac{\cosh (x) \sinh (x)}{2 b}\\ \end{align*}

Mathematica [A]  time = 0.127464, size = 52, normalized size = 0.88 \[ \frac{\frac{4 a^{3/2} \tanh ^{-1}\left (\frac{\sqrt{a} \tanh (x)}{\sqrt{a+b}}\right )}{\sqrt{a+b}}+2 x (b-2 a)+b \sinh (2 x)}{4 b^2} \]

Antiderivative was successfully verified.

[In]

Integrate[Cosh[x]^4/(a + b*Cosh[x]^2),x]

[Out]

(2*(-2*a + b)*x + (4*a^(3/2)*ArcTanh[(Sqrt[a]*Tanh[x])/Sqrt[a + b]])/Sqrt[a + b] + b*Sinh[2*x])/(4*b^2)

________________________________________________________________________________________

Maple [B]  time = 0.036, size = 188, normalized size = 3.2 \begin{align*} -{\frac{1}{2\,b} \left ( \tanh \left ({\frac{x}{2}} \right ) +1 \right ) ^{-2}}+{\frac{1}{2\,b} \left ( \tanh \left ({\frac{x}{2}} \right ) +1 \right ) ^{-1}}-{\frac{a}{{b}^{2}}\ln \left ( \tanh \left ({\frac{x}{2}} \right ) +1 \right ) }+{\frac{1}{2\,b}\ln \left ( \tanh \left ({\frac{x}{2}} \right ) +1 \right ) }+{\frac{1}{2\,{b}^{2}}{a}^{{\frac{3}{2}}}\ln \left ( \sqrt{a+b} \left ( \tanh \left ({\frac{x}{2}} \right ) \right ) ^{2}+2\,\sqrt{a}\tanh \left ( x/2 \right ) +\sqrt{a+b} \right ){\frac{1}{\sqrt{a+b}}}}-{\frac{1}{2\,{b}^{2}}{a}^{{\frac{3}{2}}}\ln \left ( -\sqrt{a+b} \left ( \tanh \left ({\frac{x}{2}} \right ) \right ) ^{2}+2\,\sqrt{a}\tanh \left ( x/2 \right ) -\sqrt{a+b} \right ){\frac{1}{\sqrt{a+b}}}}+{\frac{1}{2\,b} \left ( \tanh \left ({\frac{x}{2}} \right ) -1 \right ) ^{-2}}+{\frac{1}{2\,b} \left ( \tanh \left ({\frac{x}{2}} \right ) -1 \right ) ^{-1}}+{\frac{a}{{b}^{2}}\ln \left ( \tanh \left ({\frac{x}{2}} \right ) -1 \right ) }-{\frac{1}{2\,b}\ln \left ( \tanh \left ({\frac{x}{2}} \right ) -1 \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cosh(x)^4/(a+b*cosh(x)^2),x)

[Out]

-1/2/b/(tanh(1/2*x)+1)^2+1/2/b/(tanh(1/2*x)+1)-a/b^2*ln(tanh(1/2*x)+1)+1/2/b*ln(tanh(1/2*x)+1)+1/2/b^2*a^(3/2)
/(a+b)^(1/2)*ln((a+b)^(1/2)*tanh(1/2*x)^2+2*a^(1/2)*tanh(1/2*x)+(a+b)^(1/2))-1/2*a^(3/2)/b^2/(a+b)^(1/2)*ln(-(
a+b)^(1/2)*tanh(1/2*x)^2+2*a^(1/2)*tanh(1/2*x)-(a+b)^(1/2))+1/2/b/(tanh(1/2*x)-1)^2+1/2/b/(tanh(1/2*x)-1)+a/b^
2*ln(tanh(1/2*x)-1)-1/2/b*ln(tanh(1/2*x)-1)

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cosh(x)^4/(a+b*cosh(x)^2),x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [B]  time = 2.09016, size = 1638, normalized size = 27.76 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cosh(x)^4/(a+b*cosh(x)^2),x, algorithm="fricas")

[Out]

[1/8*(b*cosh(x)^4 + 4*b*cosh(x)*sinh(x)^3 + b*sinh(x)^4 - 4*(2*a - b)*x*cosh(x)^2 + 2*(3*b*cosh(x)^2 - 2*(2*a
- b)*x)*sinh(x)^2 + 4*(a*cosh(x)^2 + 2*a*cosh(x)*sinh(x) + a*sinh(x)^2)*sqrt(a/(a + b))*log((b^2*cosh(x)^4 + 4
*b^2*cosh(x)*sinh(x)^3 + b^2*sinh(x)^4 + 2*(2*a*b + b^2)*cosh(x)^2 + 2*(3*b^2*cosh(x)^2 + 2*a*b + b^2)*sinh(x)
^2 + 8*a^2 + 8*a*b + b^2 + 4*(b^2*cosh(x)^3 + (2*a*b + b^2)*cosh(x))*sinh(x) - 4*((a*b + b^2)*cosh(x)^2 + 2*(a
*b + b^2)*cosh(x)*sinh(x) + (a*b + b^2)*sinh(x)^2 + 2*a^2 + 3*a*b + b^2)*sqrt(a/(a + b)))/(b*cosh(x)^4 + 4*b*c
osh(x)*sinh(x)^3 + b*sinh(x)^4 + 2*(2*a + b)*cosh(x)^2 + 2*(3*b*cosh(x)^2 + 2*a + b)*sinh(x)^2 + 4*(b*cosh(x)^
3 + (2*a + b)*cosh(x))*sinh(x) + b)) + 4*(b*cosh(x)^3 - 2*(2*a - b)*x*cosh(x))*sinh(x) - b)/(b^2*cosh(x)^2 + 2
*b^2*cosh(x)*sinh(x) + b^2*sinh(x)^2), 1/8*(b*cosh(x)^4 + 4*b*cosh(x)*sinh(x)^3 + b*sinh(x)^4 - 4*(2*a - b)*x*
cosh(x)^2 + 2*(3*b*cosh(x)^2 - 2*(2*a - b)*x)*sinh(x)^2 + 8*(a*cosh(x)^2 + 2*a*cosh(x)*sinh(x) + a*sinh(x)^2)*
sqrt(-a/(a + b))*arctan(1/2*(b*cosh(x)^2 + 2*b*cosh(x)*sinh(x) + b*sinh(x)^2 + 2*a + b)*sqrt(-a/(a + b))/a) +
4*(b*cosh(x)^3 - 2*(2*a - b)*x*cosh(x))*sinh(x) - b)/(b^2*cosh(x)^2 + 2*b^2*cosh(x)*sinh(x) + b^2*sinh(x)^2)]

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cosh(x)**4/(a+b*cosh(x)**2),x)

[Out]

Timed out

________________________________________________________________________________________

Giac [B]  time = 1.30963, size = 128, normalized size = 2.17 \begin{align*} \frac{a^{2} \arctan \left (\frac{b e^{\left (2 \, x\right )} + 2 \, a + b}{2 \, \sqrt{-a^{2} - a b}}\right )}{\sqrt{-a^{2} - a b} b^{2}} - \frac{{\left (2 \, a - b\right )} x}{2 \, b^{2}} + \frac{e^{\left (2 \, x\right )}}{8 \, b} + \frac{{\left (4 \, a e^{\left (2 \, x\right )} - 2 \, b e^{\left (2 \, x\right )} - b\right )} e^{\left (-2 \, x\right )}}{8 \, b^{2}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cosh(x)^4/(a+b*cosh(x)^2),x, algorithm="giac")

[Out]

a^2*arctan(1/2*(b*e^(2*x) + 2*a + b)/sqrt(-a^2 - a*b))/(sqrt(-a^2 - a*b)*b^2) - 1/2*(2*a - b)*x/b^2 + 1/8*e^(2
*x)/b + 1/8*(4*a*e^(2*x) - 2*b*e^(2*x) - b)*e^(-2*x)/b^2